{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Overview\n",
    "\n",
    "This is a class for engineers who want to apply machine learning/deep learning to real world problems.  \n",
    "\n",
    "The material assumes no prior experience with machine learning or deep learning and tries to have as little of a math prerequisite as possible.  Unlike other introductory courses, it covers the real-world pitfalls like messy data preparation, comparing models to baselines and deploying models.  All of the material uses real-world data sets and real wolrd applications and best-in-class libraries.  I'm passionate about teaching this material becuase I think machine learning is incredibly powerful and it still isn't used as much as it could be - and I believe the limiting factor is a lack of people who know how to really make it work.\n",
    "\n",
    "Personally, I love machine learning theory as well, but this course covers much more practice than theory because there are many excellent resources online to learn the theory.  \n",
    "\n",
    "I strongly believe in learning by doing and learning by experimentation and I hope putting this course in a Jupyter notebook encourages students to explore the material and ask questions.  It should be possible to work through each notebook in under 30 minutes and if you get through all the notebooks you will learn a lot.  \n",
    "\n",
    "## Language\n",
    "\n",
    "I cover everything in python because python is by far the most popular language for deep learning.  If you haven't done any python but have done a lot of programming, you shouldn't find python too hard to pick up.  If you haven't done any programming before, I might recommend checking out Learn Python the Hard Way (https://learnpythonthehardway.org/) or many of the online courses, or if you feel ambitious, you can try to just jump right in.\n",
    "\n",
    "## Libraries\n",
    "\n",
    "1. **scikit-learn** for non-deep learning because it is the most versatile machine learning library, good for beginners and experts. \n",
    "2. **keras** and **tensorflow** for deep learning because they are standard and popular, easy to use and easy to deploy.\n",
    "3. **numpy** and **pandas** for the math and data exploration because they are so standard and useful."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Overview of Supervised Machine Learning/Deep Learning\n",
    "\n",
    "If you want to jump right in and skip this section - go for it!  It might make more sense once you have finished the courses.\n",
    "\n",
    "### Supervised Machine Learning\n",
    "\n",
    "Most of the real world applications of Machine Learning are instances of *supervised machine learning*.  In supervised machine learning you take *training data* which includes inputs and outputs and you build a model that predicts outputs from new inputs.\n",
    "\n",
    "You have probably done a linear regression in your life.  We don't always think of that as machine learning but it's definitely a simple type of machine learning.\n",
    "\n",
    "Let's do a simple example where we do a regression to predict regional house prices based on the size of houses.\n",
    "\n",
    "* input: avg house size\n",
    "* oputput: avg house price "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/l2k/.pyenv/versions/3.6.1/envs/wandb-3.6.1/lib/python3.6/site-packages/scipy/linalg/basic.py:1018: RuntimeWarning: internal gelsd driver lwork query error, required iwork dimension not returned. This is likely the result of LAPACK bug 0038, fixed in LAPACK 3.2.2 (released July 21, 2010). Falling back to 'gelss' driver.\n",
      "  warnings.warn(mesg, RuntimeWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x10ee86400>]"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAH01JREFUeJzt3Xl8VOXZ//HPFVajCEgQVExGBRfcQJGKiLIJCFprt0fNo7hGrdtjtYqOeztKbdWqtdY8Lo/6S0WrtVVwF0VcQEE2FUXBBBfQgCBiZEvu3x+ZjDkhIZMwM+fMme/79crLnGtmkm+nh2tOzn2f+5hzDhERCY88vwOIiEhqqbGLiISMGruISMiosYuIhIwau4hIyKixi4iEjBq7iEjIqLGLiISMGruISMi0zeQvKygocJFIJJO/UkQk682ePXuFc657ss/PaGOPRCLMmjUrk79SRCTrmVlFS56vUzEiIiGjxi4iEjJq7CIiIaPGLiISMmrsIiIho8YuItJKZWVlRCIR8vLyiEQilJWV+R0JyPB0RxGRsCgrK6OkpISqqioAKioqKCkpAaC4uNjPaDp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c591UjjwVpv62zpbwp22+zorGb2bZm1qnue2AUDW6gbWY9zczi3w+k9n/bSuAdoI+Z7Rb/tDwBeMrvvPHHOgNHAv9p6WtTxTm3HPjMzPaKl0YAHzR42lPAKfFZBocC3zrnlgHPA6PMrKuZdY1nfT5dWZPNa2aFwL+Ak51zi+rVA/feBmm/TXJfCMR+W8+WzvMHZr+tp8m8Kd1vMzUSvDVf1M4MmBf/eh+IxuvnAOfEvz8//tg8agceDqv3+rHAImpnGUSDkDe+fSowKZnXpjlvP2AWMJ/aUwFdG7y3BtwVf/8WAAPqvfZ04JP412kZ2h+ay3svsAqYG/+aFeD3NjD7bTJ5A7bfbkvth2DnerUg77fN5U3ZfqsrT0VEQiYrTsWIiEjy1NhFREJGjV1EJGTU2EVEQkaNXUQkZNTYRURCRo1dRCRk1NhFRELm/wPeCmsXVzFhlwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1107af550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.linear_model import LinearRegression  \n",
    "from sklearn import datasets\n",
    "import matplotlib.pyplot as plt  # matplotlib is a graphing library\n",
    "%matplotlib inline\n",
    "\n",
    "# Load the boston housing price dataset\n",
    "# Dataset of house prices by area\n",
    "boston_houses = datasets.load_boston()\n",
    "\n",
    "# load the average number of rooms for the first 20 records\n",
    "avg_rooms = boston_houses.data[:20, np.newaxis, 5]\n",
    "\n",
    "# load the price for the first 20 records\n",
    "price = boston_houses.target[:20]\n",
    "\n",
    "# build a linear regression model\n",
    "model = LinearRegression()\n",
    "model.fit(avg_rooms, price)\n",
    "\n",
    "# predict the best fit line\n",
    "preds = model.predict(avg_rooms)\n",
    "\n",
    "# graph the data\n",
    "plt.scatter(avg_rooms, price,  color='black')\n",
    "plt.plot(avg_rooms, preds)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here the black dots are data points and the blue line is our model.  If we feed 6.25 into our model, it will output 24.  If we feed 7 into our model it will output around 30. \n",
    "\n",
    "### More Complicated Regression\n",
    "\n",
    "We can build a more complicated model on just these data points in a lot of different ways."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1113c5898>]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8XGW9x/HPL3une5vubTJdaEtZuhgK2AqVfVNQFMXohYIGRC+IyJV7A+hVcxUFFdGLFtmUgVIRKBct+w5SSUuXdKEbTdrSJV3SNkmzzTz3j0wwlDaZpLOe+b5fr3k1OTOT+WU4fOfJOc/zO+acQ0REvCMj0QWIiEh0KdhFRDxGwS4i4jEKdhERj1Gwi4h4jIJdRMRjFOwiIh6jYBcR8RgFu4iIx2TF88Xy8/Od3++P50uKiKS8RYsW7XTODYr08XENdr/fT3l5eTxfUkQk5ZlZZVcer0MxIiIeo2AXEfEYBbuIiMco2EVEPEbBLiLiMQp2EZFuCgQC+P1+MjIy8Pv9BAKBRJcExHm6o4iIVwQCAUpKSqivrwegsrKSkpISAIqLixNZmkbsIiLdUVpa+mGot6mvr6e0tDRBFf2Lgl1EpBuqqqq6tD2eFOwiIt1QUFDQpe3xpGAXEemGsrIyfD7fR7b5fD7KysoSVNG/KNhFRLqhuLiYOXPmUFhYiJlRWFjInDlzEn7iFMCcc3F7saKiIqcmYCIiXWNmi5xzRZE+XiN2ERGPUbCLiHiMgl1ExGM6DXYzyzOzf5rZUjNbYWb/Hd7+gJm9b2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vDX3w7ft5TWEw+fbPf884A1tM4yKE2GesPfXw7MjeS5Ma53ClAOLKP1UED/g95bA34Xfv+WA0XtnnsFsC58mx2n/aGzev8I7AGWhG/lSfzeJs1+G0m9Sbbf9qT1Q7Bvu23JvN92Vm/U9lutPBUR8ZiUOBQjIiKRU7CLiHiMgl1ExGMU7CIiHqNgFxHxGAW7iIjHKNhFRDxGwS4i4jH/D0GEKL2w1892AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1112449b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.gaussian_process import GaussianProcessRegressor\n",
    "from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C,  WhiteKernel\n",
    "\n",
    "# initializa a model\n",
    "model = GaussianProcessRegressor(\n",
    "    kernel=C(1.0, (1e-3, 1e3)) * RBF(1.0, (1e-1, 1e1)) + WhiteKernel(1.0),\n",
    "    normalize_y=True)\n",
    "\n",
    "# fit the model\n",
    "model.fit(avg_rooms, price)\n",
    "\n",
    "# pick points to sample\n",
    "num_samples = 100\n",
    "X = np.linspace(min(avg_rooms), max(avg_rooms), num_samples).reshape(num_samples,1)\n",
    "\n",
    "preds = model.predict(X)\n",
    "plt.scatter(avg_rooms, price,  color='black')\n",
    "plt.plot(X, preds)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we used a modeling tool called a Gaussian Process to draw a line through the points.  It's no longer linear and it might fit our data better.\n",
    "\n",
    "### Too-Complicated Regression\n",
    "\n",
    "We can draw an infinite number of lines through our data.  Here's another example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1113c56a0>]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjA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"output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.gaussian_process import GaussianProcessRegressor\n",
    "from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C\n",
    "\n",
    "# initialize a model\n",
    "model = GaussianProcessRegressor(\n",
    "    kernel=C(1.0, (1e-3, 1e3)) * RBF(10, (1e-2, 1e2)),\n",
    "    normalize_y=True)\n",
    "\n",
    "# fit the model\n",
    "model.fit(avg_rooms, price)\n",
    "X = np.linspace(min(avg_rooms), max(avg_rooms), 1000).reshape(1000,1)\n",
    "preds = model.predict(X)\n",
    "\n",
    "plt.scatter(avg_rooms, price,  color='black')\n",
    "plt.plot(X, preds)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This line doesn't seem as good, but it does pass through all the points.  We would call this model \"overfitting\".\n",
    "\n",
    "This data has only one number as input, typically we might have thousands or millions of inputs.  This data also has a number as an output.  When we output a number we call the modeling problem a regression.  When we output a category, we call the modeling problem classification.  Classification and regression might seem like different problems but they are very similar.\n",
    "\n",
    "## Machine Learning Algorithms\n",
    "\n",
    "One of the most popular machine learning websites, Kaggle, did a [survey](https://www.kaggle.com/surveys/2017) in 2017 asking data scients which alogrithms they used.  Logistic Regression, a slight variant on the linear regression above was actually the most frequently used machine learning technique.\n",
    "![](images/kaggle-algorithms.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Deep Learning\n",
    "Deep Learning is the most exciting type of Machine Learning right now.  It tends to be useful when you have really large data sets and you're willing to trade compute complexity for accuracy.  As computers get faster and data sets get larger, deep learning becomes more and more important.\n",
    "\n",
    "Deep Learning typically involves using neural networks which is a class of models.  The models tend to take a longer time to train and are trickier to deploy but fundamentally deep learning is not very different from machine learning.  It tends to be especially useful in vision and speech, although these days people have found ways to apply it to nearly every problem.\n",
    "\n",
    "I typically start teaching the fundamentals of machine learning without deep learning because the models are a little faster to run and there is a lot of overlap.  But I try to get to deep learning quickly because I know that's what students are excited about and that's where most of the best models are these days.\n",
    "\n",
    "Francois Chollet, the author of the Keras deep learning library put it well:\n",
    "> The ML research community has long been driven by the need to publish, which results in a stark, sometimes ridiculous bias towards complexity. Remember to ask: \"can we do this with k-means and logistic regression?\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Key Takeaways\n",
    "\n",
    "1. Supervised machine learning/deep learning means you build a model from training data.\n",
    "2. Deep learning is a type of machine learning\n",
    "\n",
    "## Questions\n",
    "\n",
    "1. Why isn't deep learning/neural networks the most commonly used class of algorithms?\n",
    "2. Why isn't a more complicated model always better?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
